<!DOCTYPE html>
<html>
<head>
    <meta name="layout" content="main" />
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
    <g:set var="entityName" value="${message(code: 'contact.label', default: 'Contact')}" />
    <title>借款人(个人)详情</title>
    <style>
    .contact-stat{
        padding: 8px 0px;
        text-align: center;
    }
    .contact-stat span{
        font-size: 13px;
        color: #88898c;
        margin-bottom: 10px;
    }
    .contact-stat strong{
        font-size: 13px;
        word-wrap: break-word;
    }
    .nav-tabs{
        border-bottom: none;
    }
    .hpanel > .panel-footer, .hpanel > .panel-section{
        background: #f9f9f9;
    }
    .flex{
        display: flex;justify-content: center;align-items: center;
    }
    .newFontSize{
        font-size: 12px;
    }
    table>tbody>tr>td, table>tbody>tr>th,.table>tfoot>tr>td, table>tfoot>tr>th, table>thead>tr>td, table>thead>tr>th{
        padding: 8px;
        line-height: 1.42857143;
        white-space: nowrap;
    }
    .red{
        color: #e74c3c;
    }
    </style>
</head>
<body class="fixed-navbar fixed-sidebar">

<div class="small-header">
    <div class="hpanel">
        <div class="panel-body">
            <div id="hbreadcrumb" class="pull-right navFloatRight">
                <ol class="hbreadcrumb breadcrumb">
                    <li>
                        <span>CINDTATA PLS</span>
                    </li>
                    <li>
                        <g:link action="index">
                            <span>借款人(个人)</span>
                        </g:link>
                    </li>
                    <li class="active">
                        <span>借款人(个人)详情</span>
                    </li>
                </ol>
            </div>
        </div>
    </div>
</div>

<div class="content animate-panel">
    %{--押品信息--}%
    <div class="row">
        <div class="hpanel hgreen" style="">
            <div class="panel-heading">
                <div class="panel-tools">
                    <!-- <g:link action="createContactReport" id="${this?.contact?.id}" class="btn btn-info btn-xs"><i class="fa fa-edit"></i>生成报告</g:link> -->
                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                主要信息
            </div>

            <div class="panel-body">
                <div class="col-md-12 text-center">
                    <g:if test="${params.type=='5'}">
                        <div class="col-md-3" style="width: 33%;">
                            <h3 class="font-extra-bold m-b-xs text-center">
                                <small style="font-size: 16px;">信用等级 :</small>
                                <span style="font-size: 34px;color: #62cb31">AA</span>
                                <small style="font-size: 16px;color: red">已降级</small>
                                <span style="font-size: 14px">(多次逾期还款)</span>
                            </h3>
                        </div>
                    </g:if>
                    <g:else>
                        <div class="col-md-3" style="width: 33%">
                            <h3 class="font-extra-bold m-b-xs text-center">
                                <small style="font-size: 16px;">预警处置 : </small>
                                <span class="unitPrice" style="color: #62CB31">个人信用等级</span>
                            </h3>
                            <p><small style="color: #62CB31">小于A</small><span style="font-size: 14px">(多次逾期还款)</span></p>
                        </div>
                    </g:else>
                    <div class="col-md-3" style="width: 33%;">
                        <h3 class="font-extra-bold m-b-xs text-center">
                            <small style="font-size: 16px;">信用额度 :</small>
                            <span class="totalPrice">${contact?.creditAmount?contact?.creditAmount/10000:'-'}</span>
                            <small class="newFontSize">万元</small>
                        </h3>
                    </div>
                    <div class="col-md-3" style="width: 33%;">
                        <h3 class="font-extra-bold m-b-xs text-center">
                            <small style="font-size: 16px;">信用余额 :</small>
                            <span class="totalPrice">${contact?.creditBalance?contact?.creditBalance/10000:'-'}</span>
                            <small class="newFontSize">万元</small>
                        </h3>
                    </div>

                </div>
            </div>

            <div class="panel-footer contact-footer">
                <div class="row">
                    <div class="col-md-1" style="width: 16.6%;">
                        <div class="contact-stat">
                            <span>证件类型</span>
                            <strong>${contact?.identityType?.name ? contact?.identityType?.name : '-'}</strong>
                        </div>
                    </div>

                    <div class="col-md-1" style="width: 16.6%;">
                        <div class="contact-stat">
                            <span>证件号码</span>
                            <strong class="certificateFormat">${contact?.idNumber ? contact?.idNumber : '-'}</strong>
                        </div>
                    </div>

                    <div class="col-md-1" style="width: 16.6%;">
                        <div class="contact-stat">
                            <span>家庭住址</span>
                            <strong>${contact?.address}</strong>
                        </div>
                    </div>

                    <div class="col-md-1" style="width: 16.6%;">
                        <div class="contact-stat">
                            <span>户口所在地</span>
                            <strong>${contact?.householdAddress}</strong>
                        </div>
                    </div>

                    <div class="col-md-1" style="width: 16.6%;">
                        <div class="contact-stat">
                            <span>户口性质</span>
                            <strong>${contact?.householdType}</strong>
                        </div>
                    </div>

                    <div class="col-md-1" style="width: 16.6%;">
                        <div class="contact-stat">
                            <span>工作单位</span>
                            <strong>${contact?.workUnitName}</strong>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    %{--借款人信息--}%
    <div class="row">
        <div class="hpanel hgreen" style="">
            <div class="panel-heading">
                <div class="panel-tools">
                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                借款人信息
            </div>
            <div class="panel-body no-padding" style="overflow-x:auto;">
                <table class="table table-striped table-bordered table-hover text-center">
                    <thead>
                    <tr>
                        <th>姓名</th>
                        <th>性别</th>
                        <th>年龄</th>
                        <th>证件类型</th>
                        <th>证件号码</th>
                        <th>联系方式</th>
                        <th>借记卡号</th>
                        <th>出生年月日</th>
                        <th>户口所在地</th>
                        <th>户口性质</th>
                        <th>工作单位</th>
                        <th>工作单位性质</th>
                        <th>职称</th>
                        <th>职务</th>
                        <th>学历</th>
                        <th>婚姻状况</th>
                        <th>家庭月收入</th>
                        <th>信用等级</th>
                        <th>信用额度</th>
                        <th>信用余额</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr>
                        <td>${contact?.fullName}</td>
                        <td>${contact?.sex?contact?.sex:'-'}</td>
                        <td>
                            <g:if test="${contact?.birthday}">
                                ${com.cindata.DateUtilService.getAge(contact.birthday)}
                            </g:if>
                            <g:else>
                                -
                            </g:else>
                        </td>
                        <td>${contact?.identityType?contact?.identityType.name:'-'}</td>
                        <td>${contact?.idNumber}</td>
                        <td>${contact?.cellphone?contact?.cellphone:'-'}</td>
                        <td>${contact?.debitCardNumber?contact?.debitCardNumber:'-'}</td>
                        <td>
                            <g:if test="${contact?.birthday}">
                                <g:formatDate date="${contact?.birthday}" format="yyyy-MM-dd"></g:formatDate>
                            </g:if>
                            <g:else>
                                -
                            </g:else>
                        </td>
                        <td>${contact?.householdAddress?contact?.householdAddress:'-'}</td>
                        <td>${contact?.householdType?contact?.householdType:'-'}</td>
                        <td>${contact?.workUnitName?contact?.workUnitName:'-'}</td>
                        <td>${contact?.workUnitNature?contact?.workUnitNature.name:'-'}</td>
                        <td>${contact?.title?contact?.title:'-'}</td>
                        <td>${contact?.position?contact?.position:'-'}</td>
                        <td>${contact?.degree?contact?.degree:'-'}</td>
                        <td>${contact?.maritalStatus?contact?.maritalStatus:'-'}</td>
                        <td>${contact?.fmiOnLoans?contact?.fmiOnLoans:'-'}元</td>
                        <td>${contact?.creditLevel?contact?.creditLevel:'-'}</td>
                        <td>${contact?.creditAmount?contact?.creditAmount:'-'}</td>
                        <td>${contact?.creditBalance?contact?.creditBalance:'-'}</td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    %{--贷款信息--}%
    <div class="row">
        <div class="hpanel hgreen" style="">
            <div class="panel-heading">
                <div class="panel-tools">
                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                贷款信息
            </div>

            <div class="panel-body no-padding" style="overflow-x:auto;">
                <table class="table table-striped table-bordered table-hover text-center">
                    <thead>
                    <tr>
                        <th>贷款编号</th>
                        <th>贷款余额</th>
                        <th>贷款总额</th>
                        <th>成交总价</th>
                        <th>回收总本金</th>
                        <th>回收总利息</th>
                        <th>回收总罚息</th>
                        <th>贷款状态</th>
                        <th>逾期期数</th>
                        <th>担保机构</th>
                        <th>放款银行</th>
                        <th>抵押类型</th>
                        <th>贷款方式</th>
                        <th>是否不良</th>
                        <th>贷款时评估总价</th>
                        <th>贷款时评估单价</th>
                        <th>贷款到期日</th>
                        <th>贷款放款日</th>
                        <th>已还期数</th>
                        <th>剩余还款总期数</th>
                        <th>还款方式</th>
                        <th>月还款金额</th>
                    </tr>
                    </thead>
                    <tbody>
                    %{--<g:each in="${com.cindata.Mortgage.findAllByMortgageContact(contact)}">--}%
                        %{--<tr>--}%
                            %{--<td><g:link class="firstTd" style="color: #3498DB" action="show" controller="mortgage" id="${it?.id}">${it?.serialNumber?it?.serialNumber:'-'}</g:link></td>--}%
                            %{--<td>${it?.loansBalance?it?.loansBalance:'-'}元</td>--}%
                            %{--<td>${it?.loansAmount?it?.loansAmount:'-'}元</td>--}%
                            %{--<td>--}%
                                %{--<g:if test="${it?.loansEvaluateTotalPrice}">--}%
                                    %{--${com.cindata.NumberUtil.GetFixedNumber(it?.loansEvaluateTotalPrice/10000)}（万元）--}%
                                %{--</g:if>--}%
                                %{--<g:else>--}%
                                    %{-----}%
                                %{--</g:else>--}%
                            %{--</td>--}%
                            %{--<td>${it?.curRecycleTotalCapital?it?.curRecycleTotalCapital:'-'}元</td>--}%
                            %{--<td>${it?.curRecycleTotalInterest?it?.curRecycleTotalInterest:'-'}元</td>--}%
                            %{--<td>${it?.curRecycleTotalFine?it?.curRecycleTotalFine:'-'}元</td>--}%
                            %{--<td>${it?.mortgageStatus?it?.mortgageStatus?.name:'-'}</td>--}%
                            %{--<td>${it?.curOverdueDuration?it?.curOverdueDuration:'-'}</td>--}%
                            %{--<td>${it?.guaranteeInstitution?it?.guaranteeInstitution.name:'-'}</td>--}%
                            %{--<td>${it?.loansBankName?it?.loansBankName:'-'}</td>--}%
                            %{--<td>${it?.mortgageType?it?.mortgageType?.name:'-'}</td>--}%
                            %{--<td>${it?.mortgagePattern?it?.mortgagePattern?.name:'-'}</td>--}%
                            %{--<td>${it?.isNonPerformingLoan?'不良':'良'}</td>--}%
                            %{--<td>${it?.loansEvaluateTotalPrice?it?.loansEvaluateTotalPrice:'-'}元</td>--}%
                            %{--<td>${it?.loansEvaluatePrice?it?.loansEvaluatePrice:'-'}元</td>--}%
                            %{--<td>--}%
                                %{--<g:if test="${it?.endDate}">--}%
                                    %{--<g:formatDate date="${it?.endDate}" format="yyyy-MM-dd"></g:formatDate>--}%
                                %{--</g:if>--}%
                                %{--<g:else>--}%
                                    %{-----}%
                                %{--</g:else>--}%
                            %{--</td>--}%
                            %{--<td>--}%
                                %{--<g:if test="${it?.startDate}">--}%
                                    %{--<g:formatDate date="${it?.startDate}" format="yyyy-MM-dd"></g:formatDate>--}%
                                %{--</g:if>--}%
                                %{--<g:else>--}%
                                    %{-----}%
                                %{--</g:else>--}%
                            %{--</td>--}%
                            %{--<td>${it?.curHasPaymentTODuration?it?.curHasPaymentTODuration:'-'}月</td>--}%
                            %{--<td>${it?.remainTime?it?.remainTime:'-'}月</td>--}%
                            %{--<td>${it?.curRepaymentMode?it?.curRepaymentMode?.name:'-'}</td>--}%
                            %{--<td></td>--}%
                        %{--</tr>--}%
                    %{--</g:each>--}%
                    <tr>
                        <td>317888</td>
                        <td>331899.75元</td>
                        <td>880000.00元</td>
                        <td>160.60（万元）</td>
                        <td>544800.25元	</td>
                        <td>3300.00元</td>
                        <td>-元</td>
                        <td>-</td>
                        <td>-</td>
                        <td>XX住房置业担保有限公司</td>
                        <td>XX银行	</td>
                        <td>-</td>
                        <td>-</td>
                        <td>良</td>
                        <td>1606000.00元</td>
                        <td>11908.65元</td>
                        <td>-</td>
                        <td>2012-11-26</td>
                        <td>54月</td>
                        <td>151月</td>
                        <td>等额本息</td>
                        <td></td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>

<script>

    $(function () {

        $(".btnRiskWaring").click(function () {
            var contactRiskWarningDispositionId = $(this).attr("dataId").trim();
            $(".contactRiskWarningDispositionId").val(contactRiskWarningDispositionId);

        });

        $('#datepicker').datepicker({
            language: 'zh-CN'
        });
        $("#datepicker").on("changeDate", function (event) {
            $("#my_hidden_input").val(
                $("#datepicker").datepicker('getFormattedDate')
            )
        });

        $('.input-group.date').datepicker({});
        $('.input-daterange').datepicker({});
    });

    //    $('#goBack').click(function(){
    //        window.history.back(-1);
    //    })
    var riskText=$('.risk').text();
    if(riskText=='低风险>>'){
        $('.risk').css('color','#62CB31');
    }else if(riskText=='中风险>>'){
        $('.risk').css('color','#FF9800');
    }
    else if(riskText=='高风险>>'){
        $('.risk').css('color','#E51C23');
    }else{
        $('.risk').css('color','#3498DB');
    }


</script>
<script>
    function show(id){
        var url = window.location.origin+"/mortgage/show?id="+id;
        window.open(url);
    }

</script>
</body>
</html>
